Skip to content

Lockdown PIN redaction, a build guard, and favorite compaction - #11285

Merged
thebentern merged 4 commits into
developfrom
security-block-d
Jul 30, 2026
Merged

Lockdown PIN redaction, a build guard, and favorite compaction#11285
thebentern merged 4 commits into
developfrom
security-block-d

Conversation

@caveman99

@caveman99 caveman99 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Three follow-ups from the post-release backlog, one commit each. Independent of #11282, #11283 and #11284; all four branch from develop and merge cleanly in any order.

  • The bluetooth config was streamed to an unauthorized lockdown connection with fixed_pin intact, unlike the network, lora and security cases next to it which already redact. The pairing PIN is now zeroed for an unauthorized client.
  • PacketAPI::receivePacket calls service->handleToRadio() directly, bypassing handleToRadioPacket and therefore the lockdown per-connection admin gate. The two features cannot coexist today (MESHTASTIC_PHONEAPI_ACCESS_CONTROL is defined only under ARCH_NRF52, USE_PACKET_API only on esp32s3 variants), so this is a dormant guard that fails the build instead of silently shipping an admin-auth bypass if lockdown ever broadens.
  • resetNodes(keepFavorites) zeroed non-favorites in place without compacting, so a favorite above the resulting numMeshNodes was invisible to every i < numMeshNodes scan while still being serialized to flash and restored on the next load. Favorites are now compacted into contiguous low slots and the tail is cleared. This also drops a spurious double-count of the self node at index 0.

These were drafted against an older develop; each site was re-checked against current HEAD before committing.

Summary by CodeRabbit

  • Bug Fixes

    • Improved node database cleanup to keep favorite nodes intact and maintain a consistent node list.
    • Hardened Bluetooth access-control behavior to prevent unnecessary exposure of sensitive pairing details.
    • Rate-limiting now tracks activity only for a defined set of supported ports to avoid unbounded growth from other traffic.
  • Security

    • Added protections to prevent incompatible settings from undermining administrator protections during packet dispatch.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (31)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Heltec V4 heltec-v4 esp32-s3
Meshnology W10 meshnology_w10 esp32-s3
Meshnology W12 meshnology_w12 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Pocket V3 rak_wismesh_pocket nrf52840
RAK WisMesh Pod rak_wismesh_pod nrf52840
RAK WisMesh Repeater Mini V2 rak_wismesh_repeater_mini nrf52840
RAK WisMesh Tag rak_wismeshtag nrf52840
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed SenseCAP Mesh-Tracker-X1 seeed_mesh_tracker_X1 nrf52840
Seeed Wio Tracker L1 seeed_wio_tracker_L1 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LILYGO T-Impulse Plus t-impulse-plus nrf52840
LilyGo T3-C6 tlora-c6 esp32-c6
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-08-29. Updated for 7411eb3.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cb8aaac6-7e17-4383-9b16-e9b7e01b7d34

📥 Commits

Reviewing files that changed from the base of the PR and between c10adf7 and 7411eb3.

📒 Files selected for processing (3)
  • src/mesh/NodeDB.cpp
  • src/mesh/PhoneAPI.cpp
  • src/mesh/api/PacketAPI.cpp

📝 Walkthrough

Walkthrough

The changes update licensed channel initialization, favorite-node compaction, signer authorization, Bluetooth PIN redaction, port timestamp tracking, and incompatible PacketAPI build configuration handling.

Changes

Node state and authorization

Layer / File(s) Summary
Licensed initialization, node compaction, and signer authorization
src/mesh/NodeDB.cpp
Licensed resets now ensure licensed channel operation; favorite nodes are compacted and remaining slots cleared; unsigned identity updates recognize proven signers across hot and warm storage.

PhoneAPI protections

Layer / File(s) Summary
Configuration redaction and port tracking
src/mesh/PhoneAPI.cpp
Unauthorized Bluetooth responses clear fixed_pin, and lastPortNumToRadio is updated only for rate-limited ports.

PacketAPI compatibility guard

Layer / File(s) Summary
Compile-time access-control guard
src/mesh/api/PacketAPI.cpp
Builds fail when PacketAPI is compiled with phone access control enabled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: bugfix, needs-review

Suggested reviewers: thebentern, jp-bennett

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the three main changes in the PR.
Description check ✅ Passed The description clearly explains the changes, but it omits the template's attestation/testing section and hardware regression details.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security-block-d

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@caveman99 caveman99 added tech debt Code or lib references that are not up to date or propper standards bugfix Pull request that fixes bugs labels Jul 30, 2026
@caveman99
caveman99 requested a review from thebentern July 30, 2026 07:19
@thebentern
thebentern added this pull request to the merge queue Jul 30, 2026
Merged via the queue into develop with commit fc67590 Jul 30, 2026
101 of 103 checks passed
@caveman99
caveman99 deleted the security-block-d branch July 30, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs tech debt Code or lib references that are not up to date or propper standards

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants